package com.hongpu.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 项目管理
 * @author Michael zhang
 */

@Data
public class ProjectManagerVo implements Serializable {
    /**
     * 主键
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    /**
     * 项目名称
     */

    private String name;

    /**
     * 项目类型
     */

    private String type;
    private String typeName;


    /**
     * 联系人
     */

    private String contacts;

    /**
     * 联系人电话
     */

    private String contactPhone;

    /**
     * 公司名称
     */

    private String companyName;

    /**
     * 公司类型
     */

    private String companyType;
    private String companyTypeName;


    /**
     * 签订日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date dateOfSigning;

    /**
     * 施工开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date constructionStartDate;

    /**
     * 施工结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date constructionEndDate;

    /**
     * 项目金额或合同总额
     */
    private BigDecimal projectAmount =  BigDecimal.ZERO;;




    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProjectManagerVo other = (ProjectManagerVo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getContacts() == null ? other.getContacts() == null : this.getContacts().equals(other.getContacts()))
            && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
            && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
            && (this.getCompanyType() == null ? other.getCompanyType() == null : this.getCompanyType().equals(other.getCompanyType()))
            && (this.getDateOfSigning() == null ? other.getDateOfSigning() == null : this.getDateOfSigning().equals(other.getDateOfSigning()))
            && (this.getConstructionStartDate() == null ? other.getConstructionStartDate() == null : this.getConstructionStartDate().equals(other.getConstructionStartDate()))
            && (this.getConstructionEndDate() == null ? other.getConstructionEndDate() == null : this.getConstructionEndDate().equals(other.getConstructionEndDate()))
                ;

    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getContacts() == null) ? 0 : getContacts().hashCode());
        result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
        result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
        result = prime * result + ((getCompanyType() == null) ? 0 : getCompanyType().hashCode());
        result = prime * result + ((getDateOfSigning() == null) ? 0 : getDateOfSigning().hashCode());
        result = prime * result + ((getConstructionStartDate() == null) ? 0 : getConstructionStartDate().hashCode());
        result = prime * result + ((getConstructionEndDate() == null) ? 0 : getConstructionEndDate().hashCode());

        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", type=").append(type);
        sb.append(", contacts=").append(contacts);
        sb.append(", contactPhone=").append(contactPhone);
        sb.append(", companyName=").append(companyName);
        sb.append(", companyType=").append(companyType);
        sb.append(", dateOfSigning=").append(dateOfSigning);
        sb.append(", constructionStartDate=").append(constructionStartDate);
        sb.append(", constructionEndDate=").append(constructionEndDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}